﻿namespace Tombstoner
{
    using System;
    using System.Windows;

    using Microsoft.Phone.Controls;

    using WP7Contrib.View.Controls.Tombstoner;

    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();

            this.Loaded += (sender, args) => this.RestoreState();
        }

        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);

            this.PersistState();
        }

        private void TextBoxes_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/TextBoxes.xaml", UriKind.Relative));
        }

        private void ListBoxes_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/ListBoxes.xaml", UriKind.Relative));
        }

        private void Assorted_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/Assorted.xaml", UriKind.Relative));
        }

        private void Some_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/Some.xaml", UriKind.Relative));
        }

        private void PasswordBoxes_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/PasswordBoxes.xaml", UriKind.Relative));
        }

        private void CheckBoxes_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/CheckBoxes.xaml", UriKind.Relative));
        }

        private void RadioButtons_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/RadioButtons.xaml", UriKind.Relative));
        }

        private void ScrollViewers_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/ScrollViewerExample.xaml", UriKind.Relative));
        }

        private void Sliders_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/Sliders.xaml", UriKind.Relative));
        }

        private void AutoTombstonePage_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/AutoTombstone.xaml", UriKind.Relative));
        }

        private void ToggleButtons_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/ToggleButtons.xaml", UriKind.Relative));
        }

        private void HorizontalScrollViewers_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/HorizontalScrollViewer.xaml", UriKind.Relative));
        }

        private void PivotPage_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/PivotExample.xaml", UriKind.Relative));
        }

        private void PanoramaPage_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/PanoramaExample.xaml", UriKind.Relative));
        }
    }
}